from django.contrib import admin
from django.urls import path
from site01 import views

urlpatterns = [
    path('', views.index, name="index"),  # 首页
    path('employee_hours/<int:pIndex>/', views.employee_hours, name='employee_hours'),  # 人员工时表
    path('add_employee_hour', views.add_employee_hour, name='add_employee_hour'),  # 添加工时
    path('del_employee_hour/<int:dID>/', views.del_employee_hour, name='del_employee_hour'),  # 删除工时
    path('edit_employee_hour/<int:uID>/', views.edit_employee_hour, name='edit_employee_hour'),  #加载编辑人员工时表单
    path('update_employee_hours/<int:uID>/', views.update_employee_hours, name='update_employee_hours'),  # 更新工时
    path('get_employee_process/',views.get_employee_process,name='get_employee_process'),   # 获取员工默认工序
    path('batch_edit_employee_hours/<str:pName>/', views.batch_edit_employee_hours, name='batch_edit_employee_hours'),  # 加载批量添加工时表单
    path('batch_update_employee_hours/', views.batch_update_employee_hours, name='batch_update_employee_hours'),  # 批量添加工时表单

    path('machine_hours/', views.machine_hours, name='machine_hours'),  # 设备机时表

    path('employee/<int:pIndex>/', views.employee, name='employee'),  # 人员表
    path('add_employee/', views.add_employee, name='add_employee'),  # 添加人员
    path('del_employee/', views.del_employee, name='del_employee'),  # 删除人员
    path('update_employee/<str:employee_id>/', views.update_employee, name='update_employee'),  # 更新人员

    path('export_excel/', views.export_excel, name='export_excel'),  # 导出到excel文件

    path('device/', views.device, name='device'),  # 设备表
    path('add_device/', views.add_device, name='add_device'),  # 添加设备
    path('del_device/', views.del_device, name='del_device'),  # 删除设备

    path('device_type/', views.device_type, name='device_type'),  # 设备类型表
    path('add_device_type/', views.add_device_type, name='add_device_type'),  # 增加设备类型
    path('del_device_type/', views.del_device_type, name='del_device_type'),  # 删除设备类型

    path('process/', views.process, name='process'),  # 工序表
    path('del_process/', views.del_process, name='del_process'),  # 删除工序
    path('add_process/', views.add_process, name='add_process'),  # 添加工序
    path('view_process_detail/<str:process_id>/', views.view_process_detail, name='view_process_detail'),  # 显示工序详情（子工序）
    path('update_subprocess/<str:subprocess_id>/', views.update_subprocess, name='update_subprocess'),  # 更新子工序
    path('del_subprocess/', views.del_subprocess, name='del_subprocess'),  # 删除子工序
    path('add_supprocess/<str:process_id>/', views.add_supprocess, name='add_supprocess'),  # 添加子工序

    # 测试页面，主要用来测试前台页面使用光年框架
    path('mainpage/', views.main_page, name="main_page"),
]
